package cn.minhx.trigger.job;

import cn.minhx.domain.trade.service.ITradeSettlementOrderService;
import com.alibaba.fastjson2.JSON;
import jakarta.annotation.Resource;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * 拼团完结回调通知任务；拼团回调任务表；定时清理数据结转，不会有太多数据挤压
 * 
 * @author min
 */
@Slf4j
@Service
public class GroupBuyNotifyJob {

	@Resource
	private ITradeSettlementOrderService tradeSettlementOrderService;

	@Scheduled(cron = "0/15 * * * * ?")
	public void exec() {
		try {
			Map<String, Integer> result = tradeSettlementOrderService.execSettlementNotifyJob();
			log.info("定时任务，回调通知拼团完结任务 result:{}", JSON.toJSONString(result));
		} catch (Exception e) {
			log.error("定时任务，回调通知拼团完结任务失败", e);
		}
	}

}
